﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace Olitee.SchedulerWCFService
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {

#if DEBUG
            // NOTE: In debug mode, this processes requires elevated priviledges to create the WCF service.
            // The easiest way to do this is run VS2010/2012 'as Administrator'. 
            WorkSchedulerService service = new WorkSchedulerService();
            service.OnDebugStart();
            
            // In debug mode only, keep the thread active to prevent the process from exiting.
            System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);

#else
            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[] 
            { 
                new WorkSchedulerService() 
            };
            ServiceBase.Run(ServicesToRun);
#endif
        }
    }
}
